package com.emergency.evaluate.domain;

import com.emergency.base.domain.BaseEntity;
import com.emergency.base.domain.Plan;
import com.emergency.base.domain.Scenar;

import javax.persistence.*;
import java.util.List;

/**
 * 系统打分总表
 1.autoscore 储存系统打分数据和分数
 2.auto储存自动评分总分
 3.report根据autoID 自动生成评估报告
 * Created by Administrator on 2020/5/15.
 */
@Entity
@Table(name = "eva_Auto")
public class Auto extends BaseEntity {
    //评分总分数
    private double autosum;

    //本次评分对应的想定场景ID
    @OneToOne (targetEntity=Scenar.class,fetch= FetchType.EAGER)
    @JoinColumn (name="scenar_id",referencedColumnName="id")
    private Scenar scenar;

    //本次评分对应的计划ID
    @OneToOne (targetEntity=Plan.class,fetch= FetchType.EAGER)
    @JoinColumn(name="plan_id",referencedColumnName="id")
    private Plan plan;

    //打分方式,1为人工，2为系统，3 为综合评估
    private  Integer method;

    /**临时属性*/
    @Transient
    private List<Autoscore> autoscores;

    public double getAutosum() {
        return autosum;
    }

    public void setAutosum(double autosum) {
        this.autosum = autosum;
    }

    public Scenar getScenar() {
        return scenar;
    }

    public void setScenar(Scenar scenar) {
        this.scenar = scenar;
    }

    public Plan getPlan() {
        return plan;
    }

    public void setPlan(Plan plan) {
        this.plan = plan;
    }

    public Integer getMethod() {
        return method;
    }

    public void setMethod(Integer method) {
        this.method = method;
    }

    public List <Autoscore> getAutoscores() {
        return autoscores;
    }

    public void setAutoscores(List <Autoscore> autoscores) {
        this.autoscores = autoscores;
    }
}
